<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\vis\inv\bill\service\logistics;

class VibLogisticsTrackHeaderModel {
	
	static $_TSPEC;
	public $transactionId = null;
	public $bizType = null;
	public $billNo = null;
	public $logisticsNo = null;
	public $shipperCode = null;
	public $vendorCode = null;
	public $senderCountry = null;
	public $senderState = null;
	public $senderCity = null;
	public $senderRegion = null;
	public $senderAddress = null;
	public $senderPhone = null;
	public $receiverCountry = null;
	public $receiverState = null;
	public $receiverCity = null;
	public $receiverRegion = null;
	public $receiverAddress = null;
	public $receiverPhone = null;
	public $shipType = null;
	public $grossPackages = null;
	public $grossCube = null;
	public $grossWeight = null;
	public $boxNo = null;
	public $carNo = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			1 => array(
			'var' => 'transactionId'
			),
			2 => array(
			'var' => 'bizType'
			),
			3 => array(
			'var' => 'billNo'
			),
			4 => array(
			'var' => 'logisticsNo'
			),
			5 => array(
			'var' => 'shipperCode'
			),
			6 => array(
			'var' => 'vendorCode'
			),
			7 => array(
			'var' => 'senderCountry'
			),
			8 => array(
			'var' => 'senderState'
			),
			9 => array(
			'var' => 'senderCity'
			),
			10 => array(
			'var' => 'senderRegion'
			),
			11 => array(
			'var' => 'senderAddress'
			),
			12 => array(
			'var' => 'senderPhone'
			),
			13 => array(
			'var' => 'receiverCountry'
			),
			14 => array(
			'var' => 'receiverState'
			),
			15 => array(
			'var' => 'receiverCity'
			),
			16 => array(
			'var' => 'receiverRegion'
			),
			17 => array(
			'var' => 'receiverAddress'
			),
			18 => array(
			'var' => 'receiverPhone'
			),
			19 => array(
			'var' => 'shipType'
			),
			20 => array(
			'var' => 'grossPackages'
			),
			21 => array(
			'var' => 'grossCube'
			),
			22 => array(
			'var' => 'grossWeight'
			),
			23 => array(
			'var' => 'boxNo'
			),
			24 => array(
			'var' => 'carNo'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['transactionId'])){
				
				$this->transactionId = $vals['transactionId'];
			}
			
			
			if (isset($vals['bizType'])){
				
				$this->bizType = $vals['bizType'];
			}
			
			
			if (isset($vals['billNo'])){
				
				$this->billNo = $vals['billNo'];
			}
			
			
			if (isset($vals['logisticsNo'])){
				
				$this->logisticsNo = $vals['logisticsNo'];
			}
			
			
			if (isset($vals['shipperCode'])){
				
				$this->shipperCode = $vals['shipperCode'];
			}
			
			
			if (isset($vals['vendorCode'])){
				
				$this->vendorCode = $vals['vendorCode'];
			}
			
			
			if (isset($vals['senderCountry'])){
				
				$this->senderCountry = $vals['senderCountry'];
			}
			
			
			if (isset($vals['senderState'])){
				
				$this->senderState = $vals['senderState'];
			}
			
			
			if (isset($vals['senderCity'])){
				
				$this->senderCity = $vals['senderCity'];
			}
			
			
			if (isset($vals['senderRegion'])){
				
				$this->senderRegion = $vals['senderRegion'];
			}
			
			
			if (isset($vals['senderAddress'])){
				
				$this->senderAddress = $vals['senderAddress'];
			}
			
			
			if (isset($vals['senderPhone'])){
				
				$this->senderPhone = $vals['senderPhone'];
			}
			
			
			if (isset($vals['receiverCountry'])){
				
				$this->receiverCountry = $vals['receiverCountry'];
			}
			
			
			if (isset($vals['receiverState'])){
				
				$this->receiverState = $vals['receiverState'];
			}
			
			
			if (isset($vals['receiverCity'])){
				
				$this->receiverCity = $vals['receiverCity'];
			}
			
			
			if (isset($vals['receiverRegion'])){
				
				$this->receiverRegion = $vals['receiverRegion'];
			}
			
			
			if (isset($vals['receiverAddress'])){
				
				$this->receiverAddress = $vals['receiverAddress'];
			}
			
			
			if (isset($vals['receiverPhone'])){
				
				$this->receiverPhone = $vals['receiverPhone'];
			}
			
			
			if (isset($vals['shipType'])){
				
				$this->shipType = $vals['shipType'];
			}
			
			
			if (isset($vals['grossPackages'])){
				
				$this->grossPackages = $vals['grossPackages'];
			}
			
			
			if (isset($vals['grossCube'])){
				
				$this->grossCube = $vals['grossCube'];
			}
			
			
			if (isset($vals['grossWeight'])){
				
				$this->grossWeight = $vals['grossWeight'];
			}
			
			
			if (isset($vals['boxNo'])){
				
				$this->boxNo = $vals['boxNo'];
			}
			
			
			if (isset($vals['carNo'])){
				
				$this->carNo = $vals['carNo'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'VibLogisticsTrackHeaderModel';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("transactionId" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->transactionId);
				
			}
			
			
			
			
			if ("bizType" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->bizType); 
				
			}
			
			
			
			
			if ("billNo" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->billNo);
				
			}
			
			
			
			
			if ("logisticsNo" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->logisticsNo);
				
			}
			
			
			
			
			if ("shipperCode" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->shipperCode);
				
			}
			
			
			
			
			if ("vendorCode" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->vendorCode);
				
			}
			
			
			
			
			if ("senderCountry" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->senderCountry);
				
			}
			
			
			
			
			if ("senderState" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->senderState);
				
			}
			
			
			
			
			if ("senderCity" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->senderCity);
				
			}
			
			
			
			
			if ("senderRegion" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->senderRegion);
				
			}
			
			
			
			
			if ("senderAddress" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->senderAddress);
				
			}
			
			
			
			
			if ("senderPhone" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->senderPhone);
				
			}
			
			
			
			
			if ("receiverCountry" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->receiverCountry);
				
			}
			
			
			
			
			if ("receiverState" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->receiverState);
				
			}
			
			
			
			
			if ("receiverCity" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->receiverCity);
				
			}
			
			
			
			
			if ("receiverRegion" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->receiverRegion);
				
			}
			
			
			
			
			if ("receiverAddress" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->receiverAddress);
				
			}
			
			
			
			
			if ("receiverPhone" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->receiverPhone);
				
			}
			
			
			
			
			if ("shipType" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->shipType); 
				
			}
			
			
			
			
			if ("grossPackages" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->grossPackages); 
				
			}
			
			
			
			
			if ("grossCube" == $schemeField){
				
				$needSkip = false;
				$input->readDouble($this->grossCube);
				
			}
			
			
			
			
			if ("grossWeight" == $schemeField){
				
				$needSkip = false;
				$input->readDouble($this->grossWeight);
				
			}
			
			
			
			
			if ("boxNo" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->boxNo); 
				
			}
			
			
			
			
			if ("carNo" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->carNo);
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		$xfer += $output->writeFieldBegin('transactionId');
		$xfer += $output->writeString($this->transactionId);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('bizType');
		$xfer += $output->writeI64($this->bizType);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('billNo');
		$xfer += $output->writeString($this->billNo);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('logisticsNo');
		$xfer += $output->writeString($this->logisticsNo);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('shipperCode');
		$xfer += $output->writeString($this->shipperCode);
		
		$xfer += $output->writeFieldEnd();
		
		if($this->vendorCode !== null) {
			
			$xfer += $output->writeFieldBegin('vendorCode');
			$xfer += $output->writeString($this->vendorCode);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->senderCountry !== null) {
			
			$xfer += $output->writeFieldBegin('senderCountry');
			$xfer += $output->writeString($this->senderCountry);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->senderState !== null) {
			
			$xfer += $output->writeFieldBegin('senderState');
			$xfer += $output->writeString($this->senderState);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->senderCity !== null) {
			
			$xfer += $output->writeFieldBegin('senderCity');
			$xfer += $output->writeString($this->senderCity);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->senderRegion !== null) {
			
			$xfer += $output->writeFieldBegin('senderRegion');
			$xfer += $output->writeString($this->senderRegion);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->senderAddress !== null) {
			
			$xfer += $output->writeFieldBegin('senderAddress');
			$xfer += $output->writeString($this->senderAddress);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->senderPhone !== null) {
			
			$xfer += $output->writeFieldBegin('senderPhone');
			$xfer += $output->writeString($this->senderPhone);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->receiverCountry !== null) {
			
			$xfer += $output->writeFieldBegin('receiverCountry');
			$xfer += $output->writeString($this->receiverCountry);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->receiverState !== null) {
			
			$xfer += $output->writeFieldBegin('receiverState');
			$xfer += $output->writeString($this->receiverState);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->receiverCity !== null) {
			
			$xfer += $output->writeFieldBegin('receiverCity');
			$xfer += $output->writeString($this->receiverCity);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->receiverRegion !== null) {
			
			$xfer += $output->writeFieldBegin('receiverRegion');
			$xfer += $output->writeString($this->receiverRegion);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->receiverAddress !== null) {
			
			$xfer += $output->writeFieldBegin('receiverAddress');
			$xfer += $output->writeString($this->receiverAddress);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->receiverPhone !== null) {
			
			$xfer += $output->writeFieldBegin('receiverPhone');
			$xfer += $output->writeString($this->receiverPhone);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->shipType !== null) {
			
			$xfer += $output->writeFieldBegin('shipType');
			$xfer += $output->writeI64($this->shipType);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->grossPackages !== null) {
			
			$xfer += $output->writeFieldBegin('grossPackages');
			$xfer += $output->writeI32($this->grossPackages);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->grossCube !== null) {
			
			$xfer += $output->writeFieldBegin('grossCube');
			$xfer += $output->writeDouble($this->grossCube);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->grossWeight !== null) {
			
			$xfer += $output->writeFieldBegin('grossWeight');
			$xfer += $output->writeDouble($this->grossWeight);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->boxNo !== null) {
			
			$xfer += $output->writeFieldBegin('boxNo');
			$xfer += $output->writeI32($this->boxNo);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->carNo !== null) {
			
			$xfer += $output->writeFieldBegin('carNo');
			$xfer += $output->writeString($this->carNo);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>